Skip to content

Fix the detection of an unhappy installation path in a venv under Windows#554

Open
tramora wants to merge 1 commit intomainfrom
548-fix-status-pip-on-windows
Open

Fix the detection of an unhappy installation path in a venv under Windows#554
tramora wants to merge 1 commit intomainfrom
548-fix-status-pip-on-windows

Conversation

@tramora
Copy link
Collaborator

@tramora tramora commented Feb 13, 2026

External tools like VSCode can modify the case of the path saved in sys.executable

Fixes #548

The case is indeed reproductible in saving the value of sys.executable and altering its case.

Implementing an automatic test would required extracting a function returning sys.executable and mocking it during the test.
Possible but but a bit overkill.


TODO Before Asking for a Review

  • Rebase your branch to the latest version of main (or main-v10)
  • Make sure all CI workflows are green
  • When adding a public feature/fix: Update the Unreleased section of CHANGELOG.md (no date)
  • Self-Review: Review "Files Changed" tab and fix any problems you find
  • API Docs (only if there are changes in docstrings, rst files or samples):
    • Check the docs build without warning: see the log of the API Docs workflow
    • Check that your changes render well in HTML: download the API Docs artifact and open index.html
    • If there are any problems it is faster to iterate by building locally the API Docs

@tramora tramora requested review from popescu-v and removed request for popescu-v February 13, 2026 17:32
@tramora tramora force-pushed the 548-fix-status-pip-on-windows branch from 1029be1 to 92b1a47 Compare February 16, 2026 15:06
@tramora tramora requested a review from popescu-v February 16, 2026 16:00
Copy link
Collaborator

@popescu-v popescu-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comments.

- External tools like VSCode can modify for example the case of the path saved in `sys.executable`
- As a general rule paths under Windows are case-insensitive
@tramora tramora force-pushed the 548-fix-status-pip-on-windows branch from 92b1a47 to 3606064 Compare February 17, 2026 18:12
@tramora tramora requested a review from popescu-v February 17, 2026 18:13
library_root_dir = str(library_root_dir_path)
if platform.system() == "Windows":
# warning : paths are case-insensitive under Windows
library_root_dir = library_root_dir.lower()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would .lower() the user_site_packages_dir variable on Windows as well, to observe the case-insesitiveness invariant on Windows.

Copy link
Collaborator

@popescu-v popescu-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the remaining open comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spurious Warning Occurs in Binary + Pip installations on Windows

2 participants

Comments